Minimum Editing Distance Algorithm