re-implementing graph test utils
tools typechecks. added dir_eq to globals