changed matrix multiply to do sequential access over rows of B and C