Index: trunk/code/behaviors/formation_control/circle/circle.c
===================================================================
--- trunk/code/behaviors/formation_control/circle/circle.c	(revision 1626)
+++ trunk/code/behaviors/formation_control/circle/circle.c	(revision 1627)
@@ -33,7 +33,7 @@
 	if (desired_angle >= 325 && desired_angle < 348) desired_max_bom = 15;
 }
 
-void switch_sending ()
+void switch_sending(void)
 {
 	if(sending)
 	{
@@ -126,44 +126,56 @@
 
 /*~~~~~~~~~~~~~ NEED document
 */
-int correctTurn(void)
+void correctTurn(void)
 {
-	int bomNum = 0;
-	bom_refresh(BOM_ALL);
-	bomNum = bom_get_max();
-	usb_puti(bomNum);
-	if(bomNum == 4)
-	{	timeout = 0;
-		//motor_l_set(1, 200);
-		//motor_r_set(1, 200);
-		return 1; //<--------------------------------------------1 and 0 are switched
-	}
-	else
+	orb1_set_color(BLUE);			// BLUE and PURPLE
+	left(220);
+	while(1)
 	{
-		if(bomNum == -1){
-			timeout++;
-			if(timeout > 500000)
-			{
-				motor_r_set(FORWARD, 210);
-				motor_l_set(BACKWARD, 190);
-			}
-		}
-		else if((bomNum >= 12) || (bomNum < 4))
+		int bomNum = 0;				// bomNum is the current maximum reading
+		bom_refresh(BOM_ALL);
+		bomNum = bom_get_max();
+		usb_puti(bomNum);
+		if(bomNum == 4)				// when it's turned the right way, stop
 		{
-			motor_l_set(FORWARD, 200);timeout = 0;
-			motor_r_set(BACKWARD, 200);
+			timeout = 0;
+			//motor_l_set(1, 200);
+			//motor_r_set(1, 200);
+			break;					// exits the while() loop to stop the method
 		}
-		else
+		else						// facing the wrong way
 		{
-			motor_l_set(BACKWARD, 200);timeout = 0;
-			motor_r_set(FORWARD, 200);
+			if(bomNum == -1){
+				
+				timeout++;
+				
+				if(timeout > 500000)		// if it's been looking too long, move a little bit as it turns
+				{
+					motor_r_set(FORWARD, 210);
+					motor_l_set(BACKWARD, 190);
+				}
+			}
+			else if((bomNum >= 12) || (bomNum < 4))
+			{
+				motor_l_set(FORWARD, 200);
+				motor_r_set(BACKWARD, 200);
+				timeout = 0;
+			}
+			else
+			{
+				motor_l_set(BACKWARD, 200);
+				motor_r_set(FORWARD, 200);
+				timeout = 0;
+			}
 		}
 	}
-	return 0;
+	return;
 }
 
 
 /*~~~~~~~~~~~~~~ NEED document
+
+	Actually, we should just get rid of this.
 */
 void correctApproach(void)
 {
@@ -194,75 +206,6 @@
 }
 
 
-/*
-  Start turning  until the front receive the MAx bom reading
-*/
-void turn_to_beacon(int max){
-	if (max>-1 && max<16){
-		int index = (max+12)%16;
-		if (index==0) { 
-			stop(); 
-		}
-		else if (index<8) right(170);
-		else left(170);
-	}
-}
-
-
-/*
-	Start turning its fron to the MAx bom reading
-	But it won't stop by itself.
-*/
-void turn_to_beacon2(int max){				// like the previous but no stop() call'
-
-
-
-
-	if (max>-1 && max<16){
-		int index = (max+12)%16;
-		if (index==0) { 
-			 
-		}
-		else if (index<8) right(170);
-		else left(170);
-	}
-}
-
-
-
-
-/*
-	Turn towards the MAX bom direction  
-	until the front receive the MAx bom reading
-*/
-void orient(void){
-	int max_index = -1;
-	while (max_index!=4) {
-		/* Refresh and make sure the table is updated */
-		bom_refresh(BOM_ALL);
-		max_index = bom_get_max();
-		turn_to_beacon(max_index);
-		delay_ms(22);
-	}
-}
-
-
-/*
-	Turn towards the MAX bom direction  
-	until the front receive the MAx bom reading
-	
-	This function has less stop() so the robots run more smooth
-*/
-void orient2(void){
-	int max_index = -1;
-	while (max_index!=4) {
-		/* Refresh and make sure the table is updated */
-		bom_refresh(BOM_ALL);
-		max_index = bom_get_max();
-		turn_to_beacon2(max_index);
-		delay_ms(22);
-	}
-}
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 void go_straight(void){						// drives forward a hardcoded distance. May not be useful.
 	forward(200);
@@ -328,6 +271,7 @@
 	int beacon_State=0;
 	int waitingCounter=0;
 	int robotsReceived=0;
+	
 	if(wheel()<100)
 	{
 		state=EDGE;
@@ -410,8 +354,7 @@
 				// COLOR afer DONE ---> MAGENTA
 				orb_set_color(MAGENTA);
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				while(correctTurn()){				
-				}
+				correctTurn();			// turn to face the beacon
 				forward(220);
 				//range_init();
 				
@@ -534,7 +477,8 @@
 					packet_data=wl_basic_do_default(&data_length);
 					if(packet_data!=0 && data_length>=2 && packet_data[0]==CIRCLE_ACTION_ACK)
 					{
-						orb_set_color(RED);orb2_set_color(BLUE);
+						orb_set_color(RED);
+						orb2_set_color(BLUE);
 						//only add to robots seen if you haven't gotten an ACK from this robot
 						if(used[packet_data[1]]==0){		
 							robotsReceived++;
@@ -550,6 +494,7 @@
 					Sending DONE package.
 				*/	
 				case 3:
+					blink(robotsReceived);
 					orb_set_color(GREEN);
 					send_buffer[0]=CIRCLE_ACTION_DONE;
 					wl_basic_send_global_packet(42,send_buffer,2);
Index: trunk/code/behaviors/formation_control/circle/Makefile
===================================================================
--- trunk/code/behaviors/formation_control/circle/Makefile	(revision 1626)
+++ trunk/code/behaviors/formation_control/circle/Makefile	(revision 1627)
@@ -11,7 +11,8 @@
 USE_WIRELESS = 1
 
 # com1 = serial port. Use lpt1 to connect to parallel port.
-AVRDUDE_PORT = $(shell if uname -s |grep -i w32 >/dev/null; then echo 'COM4:'; else echo '/dev/ttyUSB0'; fi)
+AVRDUDE_PORT = COM4
+#AVRDUDE_PORT = $(shell if uname -s |grep -i w32 >/dev/null; then echo 'COM4:'; else echo '/dev/ttyUSB0'; fi)
 else
 COLONYROOT := ../$(COLONYROOT)
 endif
