gauss fitting almost working