added more tests and comments