refactored computedirection to use the currentXYH globals.