I think you should separate the functions .
And This is always the case
After the for loop the items will show in the program