refactoring of edge lookup
refactoring of edge lookup
now builds and stores first edge