About the function, most definitely. I'll fix this.

And about the single quote usage yes, sure thing. I just used double quotes to use single quotes on the code itself, but I'll make this change and either escape the inner single quote or use double quote.