transpose an array