     thang = thangType: thangType.get('original'), id: thangID, components: components
     if batchInsert
       @thangsBatch.push thang
-    else 
+    else
       @thangsTreema.insert '', thang
 
   editThang: (e) ->

    @editThang thangID: id if id

  batchInsert: ->
    @thangsTreema.set '', @thangsBatch
    @thangsBatch = []

  addThang: (thangType, pos, batchInsert = false) ->
    thangID = Thang.nextID(thangType.get('name'), @world) until thangID and not @thangsTreema.get "id=#{thangID}"
    @randomizeThangIDs.push thangID
    if @cloneSourceThang
      components = _.cloneDeep @thangsTreema.get "id=#{@cloneSourceThang.id}/components"
      @selectAddThang null

    @editThang thangID: e.thang.id

  onRandomizeTerrain: (e) ->
    @thangsBatch = []
    nonRandomThangs = (thang for thang in @thangsTreema.get('') when not /Random/.test thang.id)
    @thangsTreema.set '', nonRandomThangs
    for thang in e.thangs
      @selectAddThangType thang.id
      @addThang @addThangType, thang.pos, true
