Changed sampling to use Hilbert curve as suggested by Lars Grobe