Stateful execution

Make the function stateful

TBD

Last updated