added if & else if & else statement.