all tests pass, exception handling added