Working on wshed support functions like local minima detection and union-find datastructure.