Proper implementation of multivariate functions