add new implementation example of state pattern