append now return the insert index