working on transpose matrix