refactored distance controls