Added linear Gaussian model. Various algorithm tweaks.