fix bearing calculation