     distance2 *= sin(diffLon/2.0);
     distance2 *= sin(diffLon/2.0);
     distance += distance2;
-    distance = (2*atan2(sqrt(distance),sqrt(1.0-distance)));
+    distance = 2 * atan2(sqrt(distance), sqrt(1.0-distance));
     
     //Convert to meters
     distance *= 6371000.0;

  void setup(){
    lcd.begin(16, 2);              // start the library
    lcd.setCursor(0,0);
    lcd.print("NEW TESTING..."); // print a simple message
 
    //Setup compass
    slaveAddress = HMC6352Address >> 1;  
    Wire.begin();
    //Set up diagnostic output
    Serial.begin(115200);
    Serial.println("Booting ...");
    //Set gps
    mySerial.begin(4800);
    //Setup output led
    pinMode(led, OUTPUT);
    //Setup input buttons
    pinMode(buttons, INPUT);
    /* Initialise the compass */
    if(!mag.begin()){
      /* There was a problem detecting the HMC5883 ... check your connections */

    }
    
    //Diplay menu if changed
    switch(mMode){
       case MODE_MENU:
        if(isPress){
          displayMenu();
        }
       break;
       case MODE_NAVIGATE:
         executeCommand(CMD_NAVIGATE);
       break;
    }
    
    //Short delay to prevent rebounce
    delay(150);
  }
