removed unnecessary variable in calcBearing