Modified voronoiTest code