Matrix transposing, and transforming