Wrote the outOfCluster and WithinCluster methods