change graph to use constructor instead of [init]