Added the removal of edges when deleting a node, but created a new
problem - edges can't always be connected to new nodes afterwards