Got the program to work for cosine, need to find a way to check if a class exists, think about using a config file that contains all of the available functions.