Faster algorithm to compute distances. Added two new test files for this algorithm and adaptive version. Noticed an error, Trace is too long.