added random sampling of nd data from an integral hypercube