added parent on nodes and tidied up the whitespaces