persistent state

Pls rebase no merge

Using a pull request for code review purposes
You don't need a begin here, lambda can have multiple statements