break
    #print('trimmed ' + str(index) +' zeros from top')
    #print('highcount index : ', highcount)
    vecpot_slice = vecpot_slice[:modified_index]

    #print('vecpot slice last 10 , ', vecpot_slice[-10:])
    #print(np.shape(vecpot_slice))
    ylen = np.shape(vecpot)[0]
    ylenhlf = ylen/2
    time_offset = 4
    time_delay = 3
    myedge = max(int(ylenhlf - (va*.45*interval*(t-time_offset)/istep / time_delay)),scan+1)
    #myedge = 20
    #need to write a localmin func that wraps around and takes care of boundaries, didn't need this for triggered simulation, need it for untriggered
    #xpoint_list = localmin(vecpot_slice,scan, myedge)
    xpoint_list = np.array(localmin_wrap(vecpot_slice,scan))*istep / c_omp / 1000 - xext/2.
    num_xpoints = len(xpoint_list)
    print('num xpoints ',num_xpoints)

    tlow = t-tscan
    tup = t+tscan
    
    time_ycs_xpoint = []
    time_ycs_else = []
    time_gam_xpoint = []
    time_gam_else = []
    time_ycs_merger = []
    time_gam_merger = []
    dellist = []
    prtnum = np.size(tcse)
    for i in range(prtnum):
            pass
        if vecpot_slice[modified_index] != 0:
            highcount = modified_index
            break
    #print('trimmed ' + str(index) +' zeros from top')
    #print('highcount index : ', highcount)
    vecpot_slice = vecpot_slice[:modified_index]

    #print('vecpot slice last 10 , ', vecpot_slice[-10:])
    #print(np.shape(vecpot_slice))
    ylen = np.shape(vecpot)[0]
    ylenhlf = ylen / 2
    time_offset = 4
    time_delay = 3

    xpoint_list_ind = localmin_wrap(vecpot_slice, scan)

    #remove any xpoints where bdens is high
    print('original xpoint list length : ', len(xpoint_list_ind))
    #print('mean bdens : ', np.mean(bdens_slice))

    xpoint_dellist = []
    #print('max xpoint and bdens len')
    #print(max(xpoint_list_ind), np.size(bdens_slice))
    for index in range(len(xpoint_list_ind)):
        xpoint_loc = xpoint_list_ind[index]
        if bdens_slice[xpoint_loc] > 1:
            #print('bdens criterion triggered')
            #print(xpoint_loc)
            xpoint_dellist.append(index)
    xpoint_list_ind = np.array(xpoint_list_ind)