added the ability to deal with negative numbers