refactored printState to Ed's preference