Rework curry exercise to remove state bug.