public String createOutput(DialogState dialogState) {
		//get the dialog state class, old implementation gave out just the abstract name dm.dialogState
		String output = "";

		String dialogStateClass = dialogState.getClass().getCanonicalName();//getStateClassFromEnum(dialogState.getCurrentState());
		
		//tempSentence contains the sentence obtained directly from the json file, without replacements. It's a raw sentence.
		String tempSentence = findInFile(dialogStateClass, dialogState.getCurrentState().toString());
		//Add error keywords
		if( DialogManager.giveDialogManager().isInErrorState()) {
			String eOut = tempSentence;
			//if( dialogState.getOutputKeyword() != null ) {
				eOut = addEKeywords(tempSentence, dialogState.getOutputKeyword(), dialogState);
			//}
			return eOut;
		}
		String kw = dialogState.getOutputKeyword();
		
		if (kw != null) {
			output = addKeyword(tempSentence, kw, dialogState);
		} else {
			output = tempSentence;
		}
			
		// random decide whether to add a social component or not
		Random socialRandom = new Random();
		Integer toAdd = socialRandom.nextInt(2);  // 0 for no, 1 for yes
		
		if(toAdd == 1) {
			String outputWithSocialComponent = addSocialComponent(dialogState, output);
			if (outputWithSocialComponent != null) {
				output = outputWithSocialComponent;
			}
		}
		
		return output;
	}