updated junit, restructured main class for easier testing, started writing tests.