for (int j = 0; j < offsets.length; j++) {
offsets[j] = Math.abs(rand.nextInt() % 174174);
}
vals.each(new PosIterationCallback() {
@Override
public void call(int[] pos) {
for (int i = 0; i < newPos.length; i++) {
newPos[i] = (pos[i] + offsets[i]) % vals.getDimensions()[i];
}