public boolean purchase(int dispenserNumber) {
		boolean toReturn = false;
		this.isOn();
		if (!on) {
			return false;
		}
		
		try {
			//used to have an !
			if (this.dispensers.get(dispenserNumber).canBuy()){
				double price;
				if (this.moneyIn - (price = this.dispensers.get(dispenserNumber).getPrice()) >= 0) {
					FoodInfo temp = this.dispensers.get(dispenserNumber).getDispenserContents().pollFirst();
					toReturn = true;
					//throw Exception;
					//this.moneyIn -= price;
					String toPrint = "";
					//toPrint += new Date().toString() + "\n";
					toPrint += "Machine " + (this.id + 1)+ "\n";
					toPrint += "Dispenser " + (dispenserNumber + 1) + "\n";
					toPrint += "Item Purchased\tSubtotal\n";
					toPrint += temp.getName() + "\t$" + df.format(this.dispensers.get(dispenserNumber).getPrice()) + "\n\n";
					toPrint += "Money in:\t$" + df.format(this.moneyIn) + "\n";
					toPrint += "Total:\t$" + df.format(price) + "\n";
					toPrint += "Change:\t$" + df.format(this.moneyIn - price);
					printReciept(toPrint);
					if (this.moneyIn > price) {
						System.out.println("Your change is: $" + df.format(this.moneyIn - price));
					}
					this.moneyIn = 0;
					this.quantitySold.set(dispenserNumber, this.quantitySold.get(dispenserNumber) + 1);
					this.totalSales += price;
					
				} else {
					throw new InsufficientFundsException();
				}
			}
		} catch (InsufficientFundsException e) {
			System.err.println("ERROR: You have not inserted enough money");
			return false;
		} catch (InvalidChoiceException e) {
			System.err.println("ERROR: Dispenser is empty");
			return false;
		} catch (IndexOutOfBoundsException e) {
			System.err.println("ERROR: Invalid Choice(Dispenser is empty)");
			return false;
		}
		
//		if (!this.dispensers.get(dispenserNumber).getDispenserContents().isEmpty()){
//			double price;
//			if (this.moneyIn - (price = this.dispensers.get(dispenserNumber).getPrice()) >= 0) {
//				FoodInfo temp = this.dispensers.get(dispenserNumber).getDispenserContents().pollFirst();
//				toReturn = true;
//				//throw Exception;
//				//this.moneyIn -= price;
//				String toPrint = "";
//				//toPrint += new Date().toString() + "\n";
//				toPrint += "Machine " + this.id + "\n";
//				toPrint += "Dispenser " + dispenserNumber + "/n";
//				toPrint += "Item Purchased\tSubtotal\n";
//				toPrint += temp.getName() + "\t$" + df.format(this.dispensers.get(dispenserNumber).getPrice()) + "\n\n";
//				toPrint += "Money in:\t$" + df.format(this.moneyIn) + "/n";
//				toPrint += "Total:\t$" + df.format(price) + "/n";
//				toPrint += "Change:\t$" + df.format(this.moneyIn - price);
//				printReciept(toPrint);
//				if (this.moneyIn > price) {
//					System.out.println("Your change is: $" + df.format(this.moneyIn - price));
//					this.quantitySold.set(dispenserNumber, this.quantitySold.get(dispenserNumber) + 1);
//					this.totalSales += price;
//				}
//			} else {
//				System.err.println("Error Insufficient Funds");
//			}
//		} else {
//			System.err.println("Error Durring Purchase");
//		}
		
		return toReturn;
	}