Added functions for graphs