Wrote getItemFromTree method