 
 
     @files = [] # All files
-    @files.queue = [] # The files that still have to be processed
-    @files.processing = [] # The files currently processed
+    @filesQueue = [] # The files that still have to be processed
+    @filesProcessing = [] # The files currently processed
     @URL = window.URL ? window.webkitURL
     @setupEventListeners()
 

  # Goes through the queue and processes files if there aren't too many already.
  processQueue: ->
    parallelUploads = @options.parallelUploads
    processingLength = @files.processing.length
    i = processingLength

    while i < parallelUploads
      return  unless @files.queue.length # Nothing left to process
      @processFile @files.queue.shift()
      i++


  # Loads the file, then calls finishedLoading()
  processFile: (file) ->
    @files.processing.push file
    file.processing = yes

    @emit "processingfile", file

  # Called internally when processing is finished.
  # Individual callbacks have to be called in the appropriate sections.
  finished: (file, responseText, e) ->
    @filesProcessing = without(@filesProcessing, file)
    file.processing = no
    @processQueue()
    @emit "success", file, responseText, e
    @emit "finished", file, responseText, e # For backwards compatibility
    @emit "complete", file


  # Called internally when processing is finished.
  # Individual callbacks have to be called in the appropriate sections.
  errorProcessing: (file, message) ->
    @filesProcessing = without(@filesProcessing, file)
    file.processing = no
    @processQueue()
    @emit "error", file, message
    @emit "complete", file



