Update to distance forumla