Added more tests and checkInput method