adding graph logic
adding graph logic