Attempted (but failed) to make a bearing function that works properly