Edit foreach index in paper