private int bestArrangement(int mask, int currentLastWordIndex) {
		int maxScore = INVALID_SCORE;
		// myWord[currentLastWordIndex] has already been used
		if (((int) Math.pow(2, currentLastWordIndex) & mask) != 0)
			return INVALID_SCORE;
		for (int i = 0; i < myWords.length; i++) {
			if (i == currentLastWordIndex) // same number can't be used for
											// twice
				continue;
			if (prevDpState[i][mask] == INVALID_SCORE)
				continue;
			int score = prevDpState[i][mask] + calculateScore(i, currentLastWordIndex);
			if (maxScore < score)
				maxScore = score;
		}
		return maxScore;
	}