Make sure changes to state in render fn don't cause disaster
Add some doc strings