Fix some syntax errors; Use += to append to arrays rather than using loop iteration count for the element ID