Index: /vtcross/trunk/src/include/vtcross/components.h
===================================================================
--- /vtcross/trunk/src/include/vtcross/components.h	(revision 208)
+++ /vtcross/trunk/src/include/vtcross/components.h	(revision 209)
@@ -49,5 +49,4 @@
         }
 
-        
         /* Send an indentfying string for this object's component type in
          * response to a GetRemoteComponentType query.
@@ -55,14 +54,11 @@
         virtual void SendComponentType() = 0;
 
-
         /* Wait for a command signal containing task instructions.
          */
         virtual void WaitForSignal() = 0;
 
-
         /* Completely shutdown the radio and all operations.
          */
         virtual void Shutdown() = 0;
-
 
         /* Reset the radio and reload all configuration files.
@@ -71,5 +67,4 @@
          */
         virtual void Reset() = 0;
-
 
         /* Register or deregister a component with the primary radio shell.
@@ -97,5 +92,4 @@
                 const char* serverPort, const bool SML) = 0;
 
-
         /* Register or deregister services that this engine provides with the
          * service management layer.
@@ -140,10 +134,8 @@
         void TransferRadioConfiguration();
 
-        
         /* Receive information regarding a completed 'experience' and pass it on
          * to the appropriate cognitive engine.
          */
         void TransferExperience();
-
         
         /* Listen for other components registering their available services with
@@ -152,5 +144,4 @@
         void ReceiveServices();
 
-
         /* Change the active mission of the radio to a new one and adjust radio
          * behavoir appropriately.
@@ -158,9 +149,7 @@
         void SetActiveMission();
 
-
         /* List all services provided to the radio by registered components.
          */
         void ListServices();
-
 
         /* Load/Relead the XML configuration file. 
@@ -169,5 +158,4 @@
         void LoadConfiguration();
 
-
         /* The socket file descriptor information for the shell which this SML
          * is connected to.
@@ -185,5 +173,4 @@
         PolicyEngine();
         ~PolicyEngine();
-
 
         /* Overloaded constructor that creates a policy engine object and
@@ -211,5 +198,4 @@
         void ReloadPolicies();
 
-        
         /* Return a decision made by the policy engine regarding a certain set
          * of transmission parameters.
@@ -218,9 +204,7 @@
                 int32_t decision_array[]);
 
-
         /* Validate a set of transmission parameters received from the radio.
          */
         void ValidateParameters();
-
 
         /* The SML_present bool reflects whether or not the remote component
@@ -261,9 +245,7 @@
         void ReceiveRadioConfiguration();
 
-
         /* Receive an 'experience' report from the radio.
          */
         void ReceiveExperience();
-
 
         /* Find the most optimal set of transmission parameters given certain
@@ -273,5 +255,4 @@
         void GetSolution(Observable *observables);
         void GetSolution(Observable *observables, std::string service);
-
 
         /* Receive a feedback from the radio regarding the performance of a
@@ -303,6 +284,7 @@
         ~CognitiveRadioShell();
 
-
-        /* Overloaded constructor that creates a CR Shell object */ 
+        /* Overloaded constructor that creates a CR Shell object and loads the
+         * passed radio configuration XML file.
+         */
         CognitiveRadioShell(const char* radioConfig, int16_t primaryPort, \
             int16_t policyPort, int16_t commandPort);
@@ -314,4 +296,5 @@
         /* Start all the socket servers */
         void StartShellServer();
+
         int32_t LoadRadioConfiguration(const char* radioConfig, Parameter* &pList, \
             Utility* &uList, Observable* &oList, Radio_Info* radioInfo);
@@ -322,5 +305,6 @@
         void ReloadPolicies();
 
-        /* Register and Deregister the different components */
+        /* Register and Deregister the different components.
+         */
         void RegisterCognitiveEngine(int32_t socketFD);
         void DeregisterCognitiveEngine(int32_t socketFD);
@@ -330,8 +314,10 @@
         void DeregisterSML(int32_t socketFD);
 
-        /* Handle a message that is received from a component */
+        /* Handle a message that is received from a component.
+         */
         void HandleMessage(int32_t socketFD);
        
-        /* Send optimization request to primary port FD*/
+        /* Send optimization request to primary port FD.
+         */
         void GetOptimalParameters(int32_t socketFD);
 
Index: /vtcross/trunk/src/shell/CognitiveRadioShell.cpp
===================================================================
--- /vtcross/trunk/src/shell/CognitiveRadioShell.cpp	(revision 208)
+++ /vtcross/trunk/src/shell/CognitiveRadioShell.cpp	(revision 209)
@@ -62,5 +62,4 @@
     radio_info = new Radio_Info;
 
-
     LoadRadioConfiguration(radioConfig,p,u,o,radio_info);
 
@@ -78,4 +77,5 @@
 }
 
+
 void 
 CognitiveRadioShell::Shutdown()
@@ -98,4 +98,5 @@
 }
 
+
 void
 CognitiveRadioShell::SendRadioExperience(int32_t socketFD)
@@ -104,4 +105,5 @@
     LOG("Cognitive Radio Shell:: Sending radio experience to Cognitive Engine.\n");
 }
+
 
 void
@@ -117,4 +119,5 @@
 }
 
+
 void 
 CognitiveRadioShell::DeregisterCognitiveEngine(int32_t socketFD)
@@ -124,5 +127,5 @@
     numberOfCognitiveEngines--;
     if(numberOfCognitiveEngines == 0)
-    CE_present = false;
+        CE_present = false;
 
     SendMessage(socketFD, "deregister_ack");
@@ -132,4 +135,5 @@
 }
 
+
 void
 CognitiveRadioShell::RegisterPolicyEngine(int32_t socketFD)
@@ -138,4 +142,5 @@
     PE_present = true;
 }
+
 
 void 
@@ -152,4 +157,5 @@
 }
 
+
 void
 CognitiveRadioShell::RegisterSML(int32_t socketFD)
@@ -159,4 +165,5 @@
     SML_present = true;
 }
+
 
 void 
@@ -173,7 +180,9 @@
 }
 
+
 int32_t 
-CognitiveRadioShell::LoadRadioConfiguration(const char* radioConfig, Parameter* &pList, \
-    Utility* &uList, Observable* &oList, Radio_Info * radioInfo)
+CognitiveRadioShell::LoadRadioConfiguration(const char* radioConfig, \
+        Parameter* &pList, Utility* &uList, Observable* &oList, \
+        Radio_Info* radioInfo)
 {
     TiXmlElement *pElem;
@@ -193,6 +202,5 @@
     TiXmlDocument doc( radioConfig );
     bool loadOkay = doc.LoadFile();
-    if(!loadOkay)
-    {
+    if(!loadOkay) {
         ERROR(1,"Loading radio configuration failed: %s\n", radioConfig);
         return -1;
@@ -212,6 +220,6 @@
 
     for(pChild = pChild1->FirstChildElement("utility"); pChild; \
-        pChild = pChild->NextSiblingElement()) 
-    {
+        pChild = pChild->NextSiblingElement()) {
+
         const char *uName = pChild->Attribute("name");
         if(uName)
@@ -240,6 +248,6 @@
 
     for(pChild = pChild1->FirstChildElement("observable"); pChild; \
-        pChild = pChild->NextSiblingElement()) 
-    {
+        pChild = pChild->NextSiblingElement()) {
+
         const char *oName = pChild->Attribute("name");
         if(oName) 
@@ -248,17 +256,16 @@
         affect_count = 0;
         for(pSecondChild = pChild->FirstChildElement("affect"); pSecondChild; \
-            pSecondChild = pSecondChild->NextSiblingElement()) 
-        {
+            pSecondChild = pSecondChild->NextSiblingElement()) {
+
             const char *oUtilName = pSecondChild->Attribute("utility");
-            if(oUtilName) 
-            {
-                for(attribute_count = 0; attribute_count < radio_info->numUtilities; attribute_count++ ) 
-                {
-                    if(uList[attribute_count].name == oUtilName) 
-                    {
+            if(oUtilName) {
+                for(attribute_count = 0; attribute_count < radio_info->numUtilities; attribute_count++ ) {
+                    if(uList[attribute_count].name == oUtilName) {
+
                         oList[item_count].affection_list[affect_count].u = &uList[attribute_count];
                         const char *oRelate = pSecondChild->Attribute("relationship");
                         if(oRelate) 
                             oList[item_count].affection_list[affect_count].relation = oRelate;
+
                         affect_count++;
                         match_found = true;
@@ -287,6 +294,6 @@
     item_count = 0;
     for(pChild = pChild1->FirstChildElement("parameter"); pChild; \
-        pChild = pChild->NextSiblingElement()) 
-    {
+        pChild = pChild->NextSiblingElement()) {
+
         const char *pName = pChild->Attribute("name");
         if(pName) 
@@ -308,13 +315,10 @@
         affect_count = 0;
         for(pSecondChild = pChild->FirstChildElement("affect"); pSecondChild; \
-            pSecondChild = pSecondChild->NextSiblingElement()) 
-        {
+
+            pSecondChild = pSecondChild->NextSiblingElement()) {
             const char *pUtilName = pSecondChild->Attribute("utility");
-            if(pUtilName) 
-            {
-                for(attribute_count = 0; attribute_count < radio_info->numUtilities; attribute_count++) 
-                {
-                    if(uList[attribute_count].name == pUtilName) 
-                    {
+            if(pUtilName) {
+                for(attribute_count = 0; attribute_count < radio_info->numUtilities; attribute_count++) {
+                    if(uList[attribute_count].name == pUtilName) {
                         pList[item_count].affection_list[affect_count].u = &uList[attribute_count];    
 
@@ -332,6 +336,5 @@
             }
 
-            if(!match_found) 
-            {
+            if(!match_found) {
                 ERROR(1, "Error: %s: %s is not a valid utility.\n", \
                     pList[item_count].name.c_str(), pUtilName);
@@ -352,10 +355,10 @@
 }
 
+
 void
 CognitiveRadioShell::GetOptimalParameters(int32_t socketFD)
 {
-
-
-}
+}
+
 
 void
@@ -384,4 +387,5 @@
 }
 
+
 void
 CognitiveRadioShell::StartShellServer()
@@ -421,6 +425,5 @@
     }
 
-    while (running)
-    {
+    while (running) {
         /* Zero socket descriptor vector and set for server sockets */
         /* This must be reset every time select() is called */
@@ -437,24 +440,19 @@
         /* Suspend program until descriptor is ready or timeout */
         rc = select(maxDescriptor + 1, &sockSet, NULL, NULL, &selTimeout); 
-        if (rc == 0)
+        if(rc == 0)
             LOG("No echo requests for %i secs...Server still alive\n", timeout);
-        else 
-        {
+        else {
             desc_ready = rc;
 
-            for (port = 0; port <= maxDescriptor && desc_ready > 0; port++) {
-                if (FD_ISSET(port, &sockSet))
-                {
-                desc_ready -= 1;
+            for(port = 0; port <= maxDescriptor && desc_ready > 0; port++) {
+                if(FD_ISSET(port, &sockSet)) {
+                    desc_ready -= 1;
 
                     /* Check if request is new or on an existing open descriptor */
-                    if( (port == servSock[primary]) || (port == servSock[policy]) || (port == servSock[command])) { 
-                        do
-                        { 
+                    if((port == servSock[primary]) || (port == servSock[policy]) || (port == servSock[command])) { 
+                        do {
                             new_sd = AcceptTCPConnection(port);
                             if(new_sd < 0) 
-                            {
                                 break;
-                            }
                             
                             HandleMessage(new_sd);
@@ -464,6 +462,6 @@
                             //LOG("New incoming connection - %i\n\n",new_sd);
                         } while(new_sd != -1);
-                    } else {
-                        
+                    } 
+                    else {
                         //LOG("Request on already open descriptor.\n\n");
                         HandleMessage(port);
