Added missing i += 1 statement