Implemented write node function for dot graph creation.