Added in some distance functionality