add state diagram.