added matrix multiplication and transposition