Added for loop. Deleted both arr.add()
Corrected for loop parameters.