added transpose method to layer