Implemented a transpose method