uhm... this seems unnecessary. if elements are sorted during insertion why would you need to sort again after removing?