create closure for graphy