Basic class fro graph implementation