Create edge.cpp

New edge code. This has been tested.