Added catagories
Fixed minor bug with whitespace in regex
Reordered regex to check for function first