Supposed to use `lastIdx`?