Added instance method to transpose matrix