Finished implementing the add-all-edges function (finally!).