Initial pass at tree exercise.