added graph building