adding else if and else statement and return value