this version fixes the mog to run for batchsize greater than 1. Hopefully, Jascha will verify that my gradient is actually correct. Which seems like it is true because the acorr seems to go to zero