 
   generateSpellKeyToSourceMap: ->
     spellKeyToSourceMap = {}
-
     for session in @rawData.sessions
       teamSpells = session.teamSpells[session.team]
-      _.merge spellKeyToSourceMap, _.pick(session.code, teamSpells)
-
+      teamCode = {}
+      for thangName, thangSpells of session.code
+        for spellName, spell of thangSpells
+          fullSpellName = [thangName,spellName].join '/'
+          if _.contains(teamSpells, fullSpellName)
+            teamCode[fullSpellName]=spell
+            
+      _.merge spellKeyToSourceMap, teamCode
       commonSpells = session.teamSpells["common"]
       _.merge spellKeyToSourceMap, _.pick(session.code, commonSpells) if commonSpells?
 
+    
     spellKeyToSourceMap


  transpileSpell: (thang, spellKey, methodName) ->
    slugifiedThangID = _.string.slugify thang.id
    source = @currentUserCodeMap[slugifiedThangID]?[methodName] ? ""
    @spells[spellKey].thangs[thang.id].aether.transpile source

  createAether: (methodName, method) ->

        @transpileSpell thang, spellKey, methodName

  generateSpellKeyFromThangIDAndMethodName: (thang, methodName) ->
    spellKeyComponents = [thang, methodName]
    spellKeyComponents[0] = _.string.slugify spellKeyComponents[0]
    spellKey = spellKeyComponents.join '/'
    spellKey
    

  createSpellAndAssignName: (spellKey, spellName) ->
    @spells[spellKey] ?= {}
