added more tests and code