adding tests
fixing bugs that caused tests to fail