Added functionality for converting GMM into a single matrix