defining function to create example tree