Added graph function