further debug printing added; tree_beta partiale re-written