Yes, because your for loop starts from 10 and goes till 0, irrespective of explicitly giving it +1. You should change the condition in the loop as below:
for i = 0 to 10 by 1