added more tests and made some changes