added in gmm and fixed bugs in read