Add graph functions