     range *= CALIBRATE_MULTIPLIER?1.0f:BEACON_2_MULTIPLIER;
     range += CALIBRATE_OFFSET?0.0f:BEACON_2_OFFSET;
     cir_enqueue(cir2,range);
-    //dist[1] = cir_median(cir2);
-    dist[1] = range;
+    dist[1] = (USE_MEDIAN_FILT)?cir_median(cir2):range;
     
     if(CALIBRATE_OFFSET){
       if(dist[1] < shortestDistanceBeacon2 && dist[1] > 0){

#define CALIBRATE_OFFSET false
#define CALIBRATE_MULTIPLIER false
#define CALIBRATION_DISTANCE 1.0

#define BEACON_1_ADDRESS 0x1A1A
#define BEACON_2_ADDRESS 0x2A1A

    range *= CALIBRATE_MULTIPLIER?1.0f:BEACON_3_MULTIPLIER;
    range += CALIBRATE_OFFSET?0.0f:BEACON_3_OFFSET;
    cir_enqueue(cir3,range);
    dist[2] = (USE_MEDIAN_FILT)?cir_median(cir3):range;
    
    if(CALIBRATE_OFFSET){
      if(dist[2] < shortestDistanceBeacon3 && dist[2] > 0){
