Keep usage of idx here instead of nxt then the diff will be smaller.