Implemented my own type class Graph fully.