i = i + 1 changed to i += 1