Perform refactoring
Implement algorithm for choosing centroids
Fix indentation