Code for graph