added else if statement and logical opp