Updates to the distance

Doesn't get incorrect values in the distance