Changed side detection to stop falsely hitting ceilings