adding an array for the state
Merge pull request #1 from trbm/jinpa/setstate

adding an array for the state