Implemented handling of negative numbers.