darwin compatibility fix and voronoi logic outline