Need to change if(currentBearing > THRESHOLD) to if(currentBearing > THRESHOLD && currentBearing < 996)