OH I GOT THIS ONE.
so say i add three cards: card-0, card-1, card-2. all is good. i know that my next id should be card-3. but if i delete card-1, i now have 2 cards in my database, and my next id should still be card-3.

and on top of that, these cards are in whatever order the user put them in, so they're not actually sorted by id. so a) length doesn't give you the next id, and b) the last card in the array doesn't give you that. hence, you need to take the max id and go from there.

does this make any sense?