Most of the clustering framework and also added single ellipsoidal sampling