finish writer, pending compilation and bug fixes
tree manipulation