building state graph…