Edit Distance Algorithm Working