Wrote a function to transpose an array of bytearrays