fix gmm and indexing