remove beg end