moved all the classes and functions into the library