Merge pull request #358 from kjav/patch-3

Implemented state_string function