edited pseudoDistributeCenters calculation code