Fixed some bugs for centroidal generation

Added some work for #3
Fixed #1

	modified:   voronoi.js