implement the logic for memset insertion and store deletion.