Not updating pen directions of centroid
Fix a bug in compute_avg_dist()