Write tranpose function. #117.