New Version for Edit_Distance