private int[] stackDecode(DecodeHelper helper){
		// init sentences
		SortedSet<StackSentence> list = new ConcurrentSkipListSet<>();
		StackSentence hypo = new StackSentence(null, 
				LanguageModel.SENTENCE_BEGIN_WORD, helper.sourceSentence,
				helper.dictionary, helper.targetLanguageModel, helper.lengthModel);
		// stack generation loop
		for(;;){
			// add sentence end
			addNewStackSentenceToList(list, hypo, LanguageModel.SENTENCE_END_WORD, helper);
			// add all other target words
			for(int w=0; w<helper.targetWordStorage.getWordCount(); w++){
				addNewStackSentenceToList(list, hypo, w, helper);
			}
			//printStack(list, targetWordStorage);
			// promote best sentence to hypothesis
			hypo = list.last();
			list.remove(hypo);
			// check if hypothesis is complete
			if(hypo.words.length > 0) if(hypo.words[hypo.words.length-1] == LanguageModel.SENTENCE_END_WORD) break;
		}
		// hypo is the target sentence.
		return hypo.words;
	}