centralized logic in state function
Merge branch 'master' of github.com:themattchan/pebble_bop