started code to remove unreferenced surrogates from graph