added the state pattern #16
fixed typos in the state pattern
Merge pull request #23 from raslin/16-state-pattern