public static MiniCompound getEmipiricalFormula(Element[] elements, double[] percents)
	{
		//divide each percentage by the atomic weight of each corresponding element
		double lowest = 1000;
		for(int i = 0; i < percents.length; i++)
		{
			percents[i] /= elements[i].getMass();
			if(percents[i] < lowest)
				lowest = percents[i];
		}
		
		System.out.println("lowest: "+lowest);
		
		//divide by the lowest value in the array (probably oxygen)
		for(int i = 0; i < percents.length; i++)
		{
			percents[i] /= lowest;
			System.out.println("value "+i+": "+percents[i]);
		}
		
		//determine the multiplier
		int multiplier = 1;
		for(int i = multiplier; true; i++)
		{
			boolean works = true;
			for(int j = 0; j < percents.length; j++)
			{
				double testNum = percents[j]*(double)i;
				if(round(testNum) == 0)
				{
					works = false;
					break;
				}
			}
			
			if(works)
			{
				multiplier = i;
				break;
			}
		}
		
		System.out.println("Multiplier: "+multiplier);
		
		for(int i = 0; i < percents.length; i++)
			elements[i].quantity = round(percents[i] * multiplier);
		
		return new MiniCompound(elements, 1);
		
	}