cleaned up graph directive.  way too messy