Revert "state instead of stackPos"

This reverts commit 92c6bae63a1821e5601dfaf08fb2cbffcdfe3695.