public WlanScanner(){
		data = new LinkedBlockingQueue<MacRssiPair[]>(); // Queue between communicator thread and this thread
		pos = new LinkedBlockingQueue<Position>(); // Queue between this thread and the viewer thread
		sendPos = new LinkedBlockingQueue<Position>(); // Queue between this thread and the WebSender thread

        viewerInstance = new Viewer(pos);
		Thread viewer = new Thread(viewerInstance);
		viewer.start();

		if(sendToWebsite){
			Thread sender = new Thread(new WebSender(webSenderTarget, sendPos, name));
			sender.start();
		}
		
		Thread communicator = new Thread(new DataReceiver(targetIP, port, data));
		communicator.start();
		
		Position tempPos;
		while(true){
			
			try {
                MacRssiPair[] pairs = data.take();

                if(viewerInstance.isMeasuring()) {

                } else {
                    tempPos = locationHandler.locate(pairs);
                    pos.add(tempPos);
                    if(sendToWebsite) sendPos.add(tempPos);
                    System.out.println(tempPos); //When data is available give to the locationFinder
                }
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}						
		}
	}