public int getBestMove(Board testBoard, ArrayList<Piece> moves) {
    int bestMove = 0;
    TreeMap<Double, Integer> ratios = new TreeMap<Double, Integer>();
    
    for(int i = 0; i < moves.size(); i++) {
      double result = testMove(testBoard, moves.get(i));
      if(ratios.get(result) == null) {
        ratios.put(result, i);
      }
    }
    
    Entry<Double, Integer> entry = ratios.lastEntry();
    
    if(entry != null) {
      bestMove = entry.getValue();
    }
    
    return bestMove;
  }