Tidied up node creation section and added a few comments