Fixed printNode function to avoid printing nodes twice. Reformatted white space in all files