updated exercise 33 to base of stateful version of exercise 28 solution