Wrote transpose() method