deleted dead code
more tests and coverage