@Override
	public int compare(Order o1, Order o2) {
		
		if (o1.getBuysell() == Order.Buysell.BUY) {
			
			if (o1.getPrice() < o2.getPrice())
				return 1;
			else if (o1.getPrice() > o2.getPrice())
				return 0;
			else {
				if (o1.getArrivedTime() < o2.getArrivedTime()) return 0;
				else return 1;
			}
		} else {
			
			if (o1.getPrice() < o2.getPrice())
				return 0;
			else if (o1.getPrice() > o2.getPrice())
				return 1;
			else {
				if (o1.getArrivedTime() < o2.getArrivedTime()) return 0;
				else return 1;
			}
		}
	}