let undo t =
  match t.data with
    [] | [_] -> raise No_more
  | x :: q ->
      let t = { data = q; f_data = x :: t.f_data } in
      (x, t)