State transition diagram