     source: "ubret/spectra.js"
     deps: ["BaseTool"]
 
-Ubret.Loader = (tools, cb=null) ->
+Ubret.Loader = (tools, cb) ->
   isScriptLoaded = (script) ->
     not (typeof window[script] is 'undefined' or typeof Ubret[script] is 'undefined')
   


  findDeps = (deps, accum) ->
    dependencies = []
    dependencies.push Ubret.Dependencies[dep].deps for dep in deps
    dependencies = unique dependencies
    if dependencies.length is 0
      return accum
    else
      return findDeps(dependencies, accum.concat(dependencies))

  loadScripts = ->
    if tools is 0 
      return
    callback = if tools.length is 1 and cb isnt null then cb else loadScripts
    tool = tools.pop()
    unless (isScriptLoaded tool) or (isScriptLoaded Ubret.Dependencies[tool].symbol)
      source = Ubret.Dependencies[tool].source

    deps: ["BaseTool"]
  "Mapper" :
    source: "ubret/map.js"
    deps: ["BaseTool", "Leaflet"]
  "Statistics" :
    source: "ubret/statistics.js"
    deps: ["BaseTool"]
