Added naive graph implementation