Updated toward adding multivariate case