wrote more tests and did a minor fix