Draggable Elements Repeating Group - Deleting and Setting New Position Numbers

I currently have a page, similar to a trello type Kanban board. Where users can create a “list” within a repeating group. They can also drag and rearrange the position of their lists, using the draggable elements plugin. I assign a position number to the “list” when it’s created, and when a user drags it to reorder it, the position numbers are swapped.

This all works perfectly fine, but now I’m adding a feature to delete a “list” and I cannot figure out how to update the position numbers to account for that “list” being deleted. For example, currently, if I have four “lists” on the page, with position numbers of 1,2,3,4 and I delete the “list” with position number 3, the new list positions will be 1,2,4, which is an issue when the user wants to rearrange the list again.

Does anyone know of a simple solution to update all the current position numbers when a “list” is deleted?

Thank you!

In the same workflow where you delete the list you can change the number of any list with a position greater than the one being deleted to itself - 1