graph functionality implemented