public static void calculateResults(String expression, String resultsType){
	try {
	    Brain.parseClassExpression(expression);
	} catch (ParserException e) {
	    //If error, the query form is re-shown to the user
	    String trace = e.getLocalizedMessage();
	    flash.put("parsingError", trace);
	    flash.put("expression", expression);
	    query();
	}

	if(resultsType.equals("subclasses")){
	    subclasses(expression);
	}else{
	    superclasses(expression);
	}
    }