bugs/optimization in graphing