AI Loop

Added bearing code