I think that this don't work after the first iteration.
For example, I get the value 9 in the first iteration , and in the 2nd iteration it doesn't exist a value. In that case I'll get
which is wrong.
I think that the solution is to put an if clause, but the problem is that I don't know how can I check if the variable m has content or not.