let rec mem x = function
  | h :: t when h == x -> true
  | _ :: t -> mem x t
  | [] -> false