Added state pattern example