Richard's defunctionalization example