Finished implementing the first iteration of the cluster detection
algorithm