C++ Implementation of a K-Means Clustering Algorithm in 3 dimensions