Moved and oprimized distance adjustment logic