I think this re-indexing loop is no longer needed, but you should check.