Moved the code to graph.h, this file is not needed now