add max level in trees