Updates to distance library