added more tests
more tests, and a bug fix