Corrected result is (i + 1) not i