Solved matrix transpose problem