cleaned up tree.js