rotateArrays basic functionality