Tree functionality added