Fixed error in matrix multiplication