finished code review + fixed tests