removal algorithm works for all cases except for removing elements with two children