cleaned up the code, removed tests and commented sections.