debugged code, added runnable test class