cleaning up code and compiling to test