let rec tree_best_sofar (t : 'a color_tree) (lead : maybe_leader) : maybe_leader * int =
match t with
- | Leaf a -> (None, a)
+ | Leaf a -> (lead, a)
| Branch(l, col, r) ->
let (lead',left_score) = tree_best_sofar l lead in
let (lead'',right_score) = tree_best_sofar r lead' in