adding graph functions