i think a few comments would help a lot here to understand the code. if i get it right, we first delete all references originating from nodes we deleted, as we can always delete them. then we check if there are references pointing *to* the node being deleted, which after we deleted source references from this changeset means there still are references from nodes that are not deleted in the same save.

what about deleting the soft references too?