reversing the decision to change the order of looping for the matrix multiplication