canElements.removeElementAt(j);
//check if the (k-1)-sequence is contained in the set of kMinusOneSequences
int containedAt = kMinusOneSequences.indexOf(candidate);
if (containedAt != -1) {
origEvents[k] = helpEvent;
canElements.insertElementAt(origElement, j);
break;
} else {
isFrequent = false;
break;
}