updated for graph