Another: You can't rely on items.length() to provide a unique ID. If I start with two items, and delete item 0, then items.length() will return 1. But item 1 already exists, so you will add a second item with the same key as the first, which is bad.