treec should take a constriant which checks every node, not just leaves