Added test for negative numbers. Ugly parseAndCheck function added to handle negative numbers