allow for providing result state, add tests