added mailgraph function