Rewrite edges

Again just look at the latest commit :)