got 2D sampling working, can now add any number of dimensions