Further sketching of the code including tree construction