Graph update

Changed the graph class to attempt to allow for better recursion.