private static double uniform(double min, double max) 
  {
    // get random value between [0.0,1.0)
    double retval = (new Random()).nextDouble(); 
    retval = retval * (max-min);
    return retval + min;
  }