working on mode
pass graph to nngrid for access to mode data