arduino uno lcd loadingbar error

hello folks,

I'm using an arduino uno + LCD 16x2 and i want to create a loading bar.

and as lazy i am i dont want to write all of the chars. i want to write it by itself.
and this is what i got. :

if(buttons & BUTTON_RIGHT)

{
//byte[] character;
byte character[5] = {16,24,28,30,31};

byte loading[8];

for (int i = 0; i < 16; i++) // for moving the cursor
{
for (int j = 0; j < 5; j++) // for filling 5 rows
{
for (int k = 0 ; k < 8 ; k++)
{
loading[k] = character[j] ;
}
lcd.createChar(0, loading);
lcd.write(0);
delay(300);
}
lcd.setCursor(i, 0);
}
}

the problem :

the cursor doesnt move, the cursor(0,0) is only up and fills 16 times, instead of filling 1 time and move to the right.

how to solve this problem?

tnx and peace out!

The loading array is EXACTLY the same every time you call lcd.createChar(). Why do you need to do that every pass through the code? Do it ONCE in setup()!