updated statechart after testing online compiler