Compare the size of the arrays you pass to initem to the values you use for those arrays in the for loops in that function. They don't match. Make sure to check your other functions for this as well....