cleaned up code. made separate project for JUnit testing