Added bearing code to determine which direction we were traveling