The solution below is due to my late colleague John Campbell.