my implementation of the Edit Distance algorithm