Module Pattern applied
changed name graph -> digraph
a method moved to privates