added more tests, should almost complete coverage.