use vec for holding state
Merge pull request #118 from eklavya/issue-95

use vec for holding state