public static double evaluateExpression(HashMap<String,Double> elements, String line)
	{
		ArrayList<String> tokens = new ArrayList<>();
		ArrayList<Integer> flags = new ArrayList<>();		
		
		//remove whitespace
		line = removeWhitespace(line);		
		
		//separate the operations from the variables
		separateIntoTokens(tokens, flags, line);
		
		if(tokens.size() == 1)
		{
			tokens.set(0, evaluateToken(elements,tokens,0).toString());
		}
		else
		{
			//for each of the operations, calculate
			for(String operation : orderOfOperations)
			{
				for(int n=0;n<tokens.size();n++)
				{
					String token = tokens.get(n);
					if(token.equals(operation))
					{
						doOperation(elements,tokens,n,token);
						n = 0;
					}
				}
			}
		}	
		return Double.parseDouble(tokens.get(0));
	}