added graph functionality