However, I noticed that it only appends the last array item in the loop. Is this because the variable has to be recreated each time? Or because it is adding everything to accordion option before it appends? Or overwriting the same variable?