Working on state chart