Resolved block move and add based on index.
Adding index to pos and pos to index function.
Modulus by num_xblocks vs magic number.