Edge drawing

Edge drawing logic changed, must be finished.