Use a Node type to make the code clearer.

Also, fix the example