Added state diagram.