* added graph
* some refactoring