off by one on each loop