Remove some unnecessary calls
more cleanup
use Edge object for describing edges
rewrite even more code using the Edge class