Andy added code for preliminary state graph