Got rid of unecessary functions. Cleaned up code