adds the insert function that is not completely finished and SHOULD NOT BE USED, and corrects a bug in the removing part of the code