added matrix transpose code