findCentroids bug
corrected findCentroids bug, reported by Mauro Herrera