public static Cluster[] algorithmKMeans(Cluster[] kMeansClusters,
			int numOfIterations) {
		int closestCluster = 0;
		Cluster[] finalKMeansCluster = new Cluster[kMeansClusters.length];
		for (int i = 0; i < finalKMeansCluster.length; i++) {
			finalKMeansCluster[i] = new Cluster(dimensionOfDataset);
		}
		for (int numOfTimes = 0; numOfTimes < numOfIterations; numOfTimes++) {
			// for numOfIterations times, run the following code
			for (int numOfClusters = 0; numOfClusters < kMeansClusters.length; numOfClusters++) {
				// foreach cluster run the code
				for (KMeansObject aSingleObject : kMeansClusters[numOfClusters].listOfObjectInCluster) {
					closestCluster = findClosestCluster(aSingleObject,
							kMeansClusters);
					finalKMeansCluster[closestCluster].listOfObjectInCluster
							.add(aSingleObject);
				}
			}
			kMeansClusters = finalKMeansCluster;
			for (int i = 0; i < kMeansClusters.length; i++) {
				kMeansClusters[i].setMeanOfCluster();
			}
			finalKMeansCluster = new Cluster[kMeansClusters.length];
			for (int i = 0; i < finalKMeansCluster.length; i++) {
				finalKMeansCluster[i] = new Cluster(dimensionOfDataset);
			}
		}
		return kMeansClusters;
	}