added distance forumla