i++ changed to i += 1