Please change this to i++ instead of i += 1.