modified distance to one input