exercise of Graham's NLP programming tutorial