refactoring some code
Restructuring object so that the functions come in the correct order. #11