removed unused code, added more tests