update Edit_Distance