Changed the way graph is created