adjusted unit-test and formatting changed code to match formatting guidlines