public synchronized T dequeue() {
		while (queue.isEmpty()){
				try {
					this.wait();
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
		}
		T ans = queue.removeFirst();
		notifyAll();
		return ans;
	}