revised the indexing to retain original order when deleting an item and then subsequently sorting, loses reordering funtionality