Added some tests
fixed input problem