added functionality for graph