use i not absolute indices