Fred modified Palmer’s code.