Make adding edge logic more reasonable. Delete erroneous function in unit test.