Code

still WIP. added tree-descending code