Basic tree algorithms..