Functionality for graph