Code from the Node Beginner book.