finished printing graph func