Updated Graph so that it will automatically generate nodes too