off by 1 index