Refactor using transform method

Transform method takes an array of arrays and swaps rows for columns.
ZOMG so handy.