proper handling of negative numbers