//  int i;
  int row = 0, col = 0;
  int orientation = 0;
  int length = 0;
  char *dict = NULL;
//


  /*-------------------------------------------------------------*/

  /*mnem_init(argv[0]);*/

  if (argc != 3) {
    if (argc <= 2) {
      dict = "SOWPODS";
    } else {
      fprintf(stderr, "syntax: %s board.dat dict?\n", argv[0]);
      exit(1);
    }
  } else dict = argv[2]; /* Default word list is TWL98 */

  /* default param when debugging makes running gbd easier */
  if (argv[1] == NULL) boardfile = "test.txt"; else boardfile = argv[1];

  if (!dawg_init(dict, &dawg, &nedges)) {
    fprintf(stderr, "%s: cannot open wordlist '%s'\n", argv[0], dict);
    exit(2);
  }


  /* Clear the arrays */
  assert(WIDTH == HEIGHT);
  for (row = 0; row < (HEIGHT+2); row++) {
    for (col = 0; col < (WIDTH+2); col++) {
      board[row][col] = 0; apparent_letter[row][col] = 0;
      crosschecks[row][col] = NULL;
      vertical_word[row][col] = NULL;
      vindex[row][col] = 0;
    }
  }

  for (i = 0; i < 256; i++) {
    tot[i] = 2; /* Blank ;-) */
    score[i] = 0;
    totprob[i] = 0.0;
    watkins_rackvalue[i] = 25.0;
  }
#ifdef SWEDISH
  for (i = 0; i < 256; i++) {
    tot[i] = 0; /* NEED TO ADD Blank! */
    score[i] = 0;
    totprob[i] = 0.0;
    watkins_rackvalue[i] = 25.0;
  }
score[latin1_tolower('A')] = 1; tot[latin1_tolower('A')] = 8;
score[latin1_tolower('')] = 3; tot[latin1_tolower('')] = 2;
score[latin1_tolower('B')] = 4; tot[latin1_tolower('B')] = 2;
score[latin1_tolower('C')] = 10;tot[latin1_tolower('C')] = 1;
score[latin1_tolower('D')] = 1; tot[latin1_tolower('D')] = 5;
score[latin1_tolower('E')] = 1; tot[latin1_tolower('E')] = 7;
score[latin1_tolower('F')] = 3; tot[latin1_tolower('F')] = 2;
score[latin1_tolower('G')] = 2; tot[latin1_tolower('G')] = 3;
score[latin1_tolower('H')] = 2; tot[latin1_tolower('H')] = 2;
score[latin1_tolower('I')] = 1; tot[latin1_tolower('I')] = 5;
score[latin1_tolower('J')] = 7; tot[latin1_tolower('J')] = 1;
score[latin1_tolower('K')] = 2; tot[latin1_tolower('K')] = 3;
score[latin1_tolower('L')] = 1; tot[latin1_tolower('L')] = 5;
score[latin1_tolower('M')] = 2; tot[latin1_tolower('M')] = 3;
score[latin1_tolower('N')] = 1; tot[latin1_tolower('N')] = 6;
score[latin1_tolower('O')] = 2; tot[latin1_tolower('O')] = 5;
score[latin1_tolower('')] = 4; tot[latin1_tolower('')] = 2;
score[latin1_tolower('P')] = 4; tot[latin1_tolower('P')] = 2;
score[latin1_tolower('R')] = 1; tot[latin1_tolower('R')] = 8;
score[latin1_tolower('S')] = 1; tot[latin1_tolower('S')] = 8;
score[latin1_tolower('T')] = 1; tot[latin1_tolower('T')] = 8;
score[latin1_tolower('U')] = 4; tot[latin1_tolower('U')] = 3;
score[latin1_tolower('V')] = 3; tot[latin1_tolower('V')] = 2;
score[latin1_tolower('X')] = 8; tot[latin1_tolower('X')] = 1;
score[latin1_tolower('Y')] = 7; tot[latin1_tolower('Y')] = 1;
score[latin1_tolower('Z')] = 8; tot[latin1_tolower('Z')] = 1;
score[latin1_tolower('')] = 4; tot[latin1_tolower('')] = 2;
score['?'] = 0; tot['?'] = 2;
  {
    int j;
    char *nextp = FULLRACK;
    for (i = 0; i < 256; i++) {
      for (j = 0; j < tot[i]; j++) {
        *nextp++ = i;
      }
    }
    *nextp = '\0';
  }
#else
// change here for other languages
  for (i = 0; i < 26; i++) {
    tot['a'+i] = itot[i];
    score['a'+i] = iscore[i];
    watkins_rackvalue['a'+i] = iwatkins_rackvalue[i];
  }
#endif

  /* hand-coded random board.  This could be replaced by a more complex
     format which includes tile distributions, values, language etc */
  {int score; for (score = 0; score < MAX_PLAYSCORE; score++) playscore[score] = 0.0;}

  strcpy(fullrack, FULLRACK); /* If no tiles given in file, do megamove analysis */

  read_board_for_opps_move(boardfile);

  if (tiles[0] == '\0') {
    megaanalysis = TRUE;
    tiles_held = strlen(fullrack);
    strcpy(tiles, fullrack);
  }
  fprintf(logfile, "\nUnseen tiles are: %s\n\n", fullrack);

//fprintf(stderr, "test X\n"); fflush(stderr);