moved graph var up so that it can be defined quickly