fixed condition in matrix mul loop