First working version of GMM unaries. Takes five minutes to run.