def manage_threads
      Thread.new do 
        while(@threads.size > 0)
          done = []
          @threads.each do |t|
            done << t if t[:thread_state] == "done" || !t.status
            # puts t.object_id.to_s + "--" + t.status.to_s + "--" + t.to_s
            # raise "Nil Thread State" if t[:thread_state].nil?
          end
          done.each{|d| @threads.delete(d)} # Clear dead threads
          
          # If no more jobs are left, mark done

          if done?
            @done = true
          else
            puts "Sleeping for 2"
            sleep 2 # Wait for more threads to spawn
          end

        end
      end
    end
def manage_threads
      Thread.new do 
        while(@threads.size > 0)
          done = []
          @threads.each do |t|
            done << t if t[:thread_state] == "done" || !t.status
            # puts t.object_id.to_s + "--" + t.status.to_s + "--" + t.to_s
            # raise "Nil Thread State" if t[:thread_state].nil?
          end
          done.each{|d| @threads.delete(d)} # Clear dead threads
          
          # If no more jobs are left, mark done

          if done?
            @done = true
          else
            puts "Sleeping for 2"
            sleep 2 # Wait for more threads to spawn
          end

        end
      end
    end
Clears dead threads,
 frees thread pool for more jobs
 Exits when no more threads are left