Fixed negative number bug, added unit test for negative numbers