use else if to avoid repeating the conditions above