Simplified the if-else statement for comparing the operands.