some major changes (I hope that's ok...)

* edges are now displayed properly!
* did a lot of refactoring
* added Javadoc comments