Reuse the same matrix throughout the loop