add some tests for Distance
start algorithem