t = mindRunClock.getTime()
 frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
 # update/draw components on each frame
 
 #--- TCPIP RECV 
 # check the network interface for new data
 data=[]
 try:
     data = conn.recv(BUFFER_SIZE)
 except socket.error as ex:
     pass
     
 if data:
     print('received %s\n'%(data))
     try:
         tcp_dist=float(data.split('\n')[0]);
     except:
         tcp_dist=0.0;
     print('converted to %f\n'%(tcp_dist))
  
     if DETREND == 1:
         time_array=time_array+[t]
         dist_array=dist_array+[tcp_dist]
         dist_detrend = detrendDist(time_array, dist_array)
     else:
         dist_detrend = tcp_dist
  #--- TCPIP RECV
  
 if playerNdx ==  1:
     dist_detrend=np.random.normal(0,3.0, 1)