I didn't change that, the only change in that line is that I defined the index var outside of the if. Anyway, index contains gridPosition.page and appendIconAt receives gridPosition.index.