private string buildKey(int startIndex)
{
StringBuilder sb = new StringBuilder();
//Append the initial word out of the loop to avoid appending an extra space
sb.Append(words[startIndex]);
for (int i = startIndex + 1; i < (startIndex + k); i++)
{
sb.Append(" ");
sb.Append(words[i]);
}
return sb.ToString();
}