added more tests and did a bit of clean up