Tree problems updated + arrays