added distance version