let compare d1 d2 = let p = part_of_item d1.d_item - part_of_item d2.d_item in if p = 0 then String.compare d1.d_name d2.d_name else p