public int[] selectRandom(){
    calculateMoleculeID(0,0, new int[0]);
    ArrayList<Molecule> arr = new ArrayList<Molecule>();
    Molecule selected = new Molecule();
    int n;
    double rand;
    
    //Sorts THIS molecule into an array
    arr = sortIntoArray(arr);
    
    for(int i=0; i<arr.size(); i++){
      //System.out.printf("%d\t", arr.get(i).getID());
      n=i+1;
      selected = (Math.random() <= (double)1/(double)n) ? arr.get(i) : selected;
      //System.out.printf(""+Arrays.toString(arr.get(i).getMolID())+"\n");
  
    }
    //System.out.printf("\n");
    
    return selected.getMolID();
  
  }