Optimise tree_list_append from O(n) to O(1)