resed_diff_tail/3 -> replace_tail/4