Sorry, last commit broke the code. I had to make a separate plugin function.