updated state pattern diagram