cleanup, fix *(ptr+i)