I see. But the run() function will call the matrix exactly 20 times though, so there is same number of matrix() call for each run().

Maybe I overlooked something? Or matrix cannot be called in "while" loop?