Change [min_key] [max_key] to [min_elt] and [max_elt]
same as before