     remaining = data.total - data.done
     $("#counter").text remaining
 
-updateDetails = (challenge) ->
+updateChallengeDetails = (challenge) ->
   ###
   # Use the current challenge metadata to fill in the web page
   ###

    if data.tileurl? and data.tileurl != tileURL
      tileURL = data.tileurl
      tileAttrib = data.tileasttribution if data.tileattribution?
      initmap()

@init = ->
  ###
  # Find a challenge and set the map up
  ###
  # Set up the map
  map = new L.Map "map"
  osmLayer = new L.TileLayer(tileUrl, attribution: tileAttrib)
  map.setView new L.LatLng(40.0, -90.0), 17
  map.addLayer osmLayer
  # We need an onEachFeature function to create markers later
  geojsonLayer = new L.geoJson(null, {
      onEachFeature: (feature, layer) ->
        if feature.properties and feature.properties.text
          layer.bindPopup(feature.properties.text)
          layer.openPopup()})
  map.addLayer geojsonLayer

  # add keyboard hooks
  if enablekeyboardhooks

        when "i"
          openIn('id')

  # Set up the map
  map = new L.Map "map"
  osmLayer = new L.TileLayer(tileUrl, attribution: tileAttrib)
  map.setView new L.LatLng(40.0, -90.0), 17
  map.addLayer osmLayer
  # We need an onEachFeature function to create markers later
  geojsonLayer = new L.geoJson(null, {
      onEachFeature: (feature, layer) ->
        if feature.properties and feature.properties.text
          layer.bindPopup(feature.properties.text)
          layer.openPopup()})
  map.addLayer geojsonLayer

  # Try to grab parameters from the url
  challenge = $(document).getUrlParam("challenge")
  difficulty = $(document).getUrlParam("difficulty")
