negative number handled in function