add case to speed up transpose also, and unit test to mkae sure it works