public void actionPerformed (ActionEvent event)
		{
			
			
			if (event.getSource() == begin)
			{	
				int i = 0;
				double d = 0.00; 

				String nump = NumProducts.getText();
				String dprice = DesiredPrice.getText();
				String s = OptionalAdditions.getText();

				output.setText(" ");
				
				errlabel1.setForeground(Color.red);
				errlabel2.setForeground(Color.red);
				
				quantity.setText("");
				cost.setText("");
				additional.setText("");
				
				//error checks number of products input
				try 
				{
					i = Integer.parseInt(nump.trim());
				} 
				catch (NumberFormatException e)
				{
					errlabel1.setText ("\t\tQuantity of Products must be of format # and larger than 0. Please Try Again");
				}

				//error checks desired price input
				try 
				{
					d = Double.parseDouble(dprice.trim());
				} 
				catch (NumberFormatException e)
				{
					errlabel2.setText ("\t\tDesired Price must be of format #.## and larger than 0. Please Try Again");
				}
				
				//error checks so that input is larger than zero. 
				if(i < 1) 
				{
					errlabel1.setText ("\t\tQuantity of products must be of format # and larger than 0. Please Try Again");
				} 
				//error checks so that input is larger than zero. 
				else if(d <= 0) 
				{
					errlabel2.setText ("\t\tDesired Price must be of format #.## and larger than 0. Please Try Again");
				} 
				//otherwise, if no errors, then have valid inputs and can stop loop
				else 
				{
					errlabel1.setText("");
					errlabel2.setText("");
					notificationlabel.setText("");
					NumProducts.setText("");
					DesiredPrice.setText("");
					OptionalAdditions.setText("");
					
					//rounds numbers to appropriate cents 
					d = Math.round(d*100)/100.0d;
					//gets the optional search criteria
					if(s == "")
					{
						s = "None";
					}
					
					cost.setText(" $" + d + "   ");
					quantity.setText(" " + i + "    ");
					additional.setText(" " + s);
					
					cost.setForeground (Color.white);
					quantity.setForeground (Color.white);
					additional.setForeground(Color.white);
					
					NumberCrunch crunch = new NumberCrunch(d, i, s);
					try 
					{
						output.append(crunch.getLists() + newline);
						//System.out.println(crunch.getProductLists() + newline);
					} 
					catch (org.json.simple.parser.ParseException e) 
					{
						// TODO Auto-generated catch block
						notificationlabel.setText ("An error has occurred. We apologize for the inconvenience.");
						e.printStackTrace();
						
					} 
					catch (IOException e) {
						// TODO Auto-generated catch block
						notificationlabel.setText ("An error has occurred. We apologize for the inconvenience.");
						e.printStackTrace();
					}
					//notificationlabel.setText("Results:");
				}
					
			}
			
			
		}