private int processOrderList(ArrayList<Trade> trades, OrderList orders,
								int qtyRemaining, String side, String takerId, 
								int time, boolean verbose) {
		// TODO Have already checked 'side' before this function is called so, 
		// for efficiency, should probably have a processBestAsks and processBestBids.
		String buyer, seller;
		while ((orders.getLength()>0) && (qtyRemaining>0)) {
			int qtyTraded = 0;
			Order headOrder = orders.getHeadOrder();
			if (qtyRemaining < headOrder.getQuantity()) {
				qtyTraded = qtyRemaining;
				if (side=="offer") {
					this.bids.updateOrderQty(headOrder.getQuantity()-qtyRemaining, 
											 headOrder.getOrderId());
				} else {
					this.asks.updateOrderQty(headOrder.getQuantity()-qtyRemaining, 
											 headOrder.getOrderId());
				}
				qtyRemaining = 0;
			} else {
				qtyTraded = headOrder.getQuantity();
				if (side=="offer") {
					this.bids.removeOrderByID(headOrder.getOrderId());
				} else {
					this.asks.removeOrderByID(headOrder.getOrderId());
				}
				qtyRemaining -= qtyTraded;
			}
			if (side=="offer") {
				buyer = headOrder.getFirmId();
				seller = takerId;
			} else {
				buyer = takerId;
				seller = headOrder.getFirmId();
			}
			Trade trade = new Trade(time, headOrder.getPrice(), qtyTraded, 
									headOrder.getFirmId(),takerId, buyer, seller, 
									headOrder.getOrderId());
			trades.add(trade);
			this.tape.add(trade);
			if (verbose) {
				System.out.println(trade);
			}
		}
		return qtyRemaining;
	}