-added method to print node state
-reset node state in clearGraph() method