changes to writeDotRecursive