Improved test function: now displays the graph name in addition to its number