How to work with 4 sets of data and 2 variables?

This would work also. I usually avoid division - which is what the modulo operation may entail for values that are not a power of two - but division is likely to be quicker than moving a bunch of data. Good one!