If j starts at 5 and the loop condition is j>1 you'll get only 4 iterations (j = 5, 4, 3, 2)
The condition should be j>0 (or j>=1 if you prefer).