confirmed 3 dimensional working

fixed small error when using nDims = 3