added test for negative numbers to throw an exception