trying to implement graph