completely rework add and delete to make better use of recursion (avoid use of stack)