public void start() {
		this.connect();
		
		long beginTime = System.currentTimeMillis();
		
		if (this.connected) {			
			this.statusLog.logStatus("Worker connected!");
			
			// Start receive and send threads			
			this.threadPool.execute(new SocketThread(this));
			int runningCount = 0;
			this.crawlCount = 0;
			
			try {
				while (this.connected) {								
					// Spawn any new crawler tasks necessary
					while (this.inQueue.size() > 0 && runningCount < MAX_CONCURRENCY) {
						synchronized(this.inQueue) {
							int nextId = this.inQueue.removeFirst();
							CrawlTask task = new CrawlTask(nextId, this.username, this.password);
							this.threadPool.execute(task);
							this.tasks.add(task);
							runningCount++;
						}
						Thread.sleep(SLEEP_INTERVAL);
					}
				
					// Loop through current tasks, writing results to outQueue and popping as necessary
					Iterator<CrawlTask> iter = this.tasks.iterator();
					while (iter.hasNext()) {
						CrawlTask task = iter.next();
						if (task.isFinished()) {
							synchronized(this.outQueue) {
								this.outQueue.add(task.getResult());
							}
							iter.remove();
							runningCount--;		
							this.crawlCount++;
							
							// Log statement
							if (this.crawlCount % 1000 == 0 && this.crawlCount > 0) {
								long currentTime = System.currentTimeMillis();
								this.statusLog.logStatus("Crawled " + crawlCount + " in " + ((currentTime - beginTime)/1000) + " seconds.");
							}
						}
					}
					Thread.sleep(500);
				}
				
				// We're done, so clean up
				this.threadPool.shutdownNow();
			} catch (Exception e) {
				this.statusLog.logError("Error in main loop - " + e);
				System.exit(-1);
			}
		} else {
			this.statusLog.logError("Failed to connect.");
		}
	}