finish basic graph implementation.