rotateMatrix function

Rotate values in a matrix