Implemented a funciton to calc edit distance. #5.