combining tree logic