function getWeather(lat, lon) {
    $.ajax({
        url: "http://api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon + "&APPID=2ca252d74a373acc1b59fe6e45e5d3ae",
        dataType: "jsonp",
        success: function (data) {
            // get all the information
            var kelvin = data.main.temp,
            locationName = data.name,
            icon = data.weather[0].id,
            //apparently the temperature is returned in kelvin, so we need to quickly convert it to celsius, which gives a horrible number so is rounded to two decimal places. 
                celsius = (kelvin - 273.15).toFixed(2),
                fahrenheit = (1.8 * (kelvin - 273.15) + 32).toFixed(2); // Who in the name of all that is holy uses Fahrenheit? 
            console.log(celsius); // Wh
            $("#tempC").html(celsius + "&deg;C");
            $("#locationName").html(locationName);
            $("#icon").addClass("owf owf-" + icon);
            $("#tempF").html(fahrenheit + "&deg;F").hide();

            $("#toggle").click(function () {
                $("#tempC").toggle("slow");
                $("#tempF").toggle("slow");
            });

            //Alters all of the elements to display the information to the user. 

        }
    });
}
// Gets the users position 
if (navigator.geolocation) { // Gets the users position 
    navigator.geolocation.getCurrentPosition(function (position) {
        $("#data").html("latitude: " + position.coords.latitude + "<br>longitude: " + position.coords.longitude);
        var lat = position.coords.latitude,
            lon = position.coords.longitude;
        getWeather(lat, lon); // Calls the getWeather function which is defined above. Passes two arguments which are the user's current lattitude and longitude. 
    });
}
// If there is no location the code stalls and temp is replaced with a message telling the user to turn location on!

// API key ""2ca252d74a373acc1b59fe6e45e5d3ae""
@@ -1,16 +1,17 @@
+ 
 function getWeat
@@ -29,17 +29,16 @@
 n) %7B%0A   
- 
 $.ajax(%7B
@@ -38,19 +38,16 @@
 .ajax(%7B%0A
-   
      url
@@ -174,19 +174,16 @@
 %22,%0A     
-   
 dataType
@@ -198,19 +198,16 @@
 %22,%0A     
-   
 success:
@@ -215,17 +215,16 @@
 function
- 
 (data) %7B
@@ -231,21 +231,16 @@
 %0A       
-     
 // get a
@@ -265,21 +265,16 @@
 %0A       
- 
-    
 var kelv
@@ -292,25 +292,25 @@
 ain.temp
-,
+;
 %0A       
      loc
@@ -301,20 +301,19 @@
 %0A       
-    
+var
  locatio
@@ -329,29 +329,28 @@
 ata.name
-,%0A 
+;%0A
        
-   
+var
  icon = 
@@ -367,23 +367,46 @@
 er%5B0%5D.id
-,
+;
 %0A     
+  console.log(kelvin);%0A
        /
@@ -576,24 +576,19 @@
 %0A       
-        
+var
  celsius
@@ -618,25 +618,25 @@
 Fixed(2)
-,
+;
 %0A       
         
@@ -627,24 +627,19 @@
 %0A       
-        
+var
  fahrenh
@@ -751,21 +751,16 @@
 %0A       
- 
-    
 console.
@@ -779,21 +779,16 @@
 ; // Wh%0A
-     
        $
@@ -827,29 +827,24 @@
 C%22);%0A       
-   
-  
 $(%22#location
@@ -873,29 +873,24 @@
 me);%0A       
-    
- 
 $(%22#icon%22).a
@@ -920,29 +920,24 @@
 on);%0A       
-    
- 
 $(%22#tempF%22).
@@ -972,22 +972,24 @@
 hide();%0A
-%0A
+  
      
+%0A
        $
@@ -1018,12 +1018,10 @@
 tion
- 
 ()
- 
 %7B%0A  
@@ -1019,39 +1019,32 @@
 ion()%7B%0A         
-    
-   
 $(%22#tempC%22).togg
@@ -1049,33 +1049,25 @@
 ggle(%22slow%22)
-;%0A       
+%0A
          $(%22
@@ -1089,23 +1089,17 @@
 (%22slow%22)
-;%0A     
+%0A
        %7D
@@ -1102,21 +1102,16 @@
    %7D);%0A%0A
-     
        /
@@ -1189,23 +1189,21 @@
     
-   
 %7D%0A   
- 
 %7D);%0A
+ 
 %7D%0A
+ 
 // G
@@ -1226,16 +1226,17 @@
 sition %0A
+ 
 if (navi
@@ -1287,17 +1287,16 @@
 ion %0A   
- 
 navigato
@@ -1336,17 +1336,16 @@
 function
- 
 (positio
@@ -1350,27 +1350,24 @@
 ion) %7B%0A     
-  
- 
 $(%22#data%22).h
@@ -1461,27 +1461,24 @@
 tude);%0A     
-   
 var lat = po
@@ -1503,21 +1503,18 @@
 tude
-,
+;
 %0A     
-      
+var
  lon
@@ -1548,19 +1548,16 @@
 e;%0A     
-  
- 
 getWeath
@@ -1710,15 +1710,16 @@
 %0A   
- 
 %7D);%0A
+ 
 %7D%0A
+ 
 // I
@@ -1832,16 +1832,17 @@
 on on!%0A%0A
+ 
 // API k

Revert "Change API call to http://"