anchor.diff:          ! Out:
           !    ret: the index of the element chosen.
   
  -        ! [review] - JSS: I think the switch (multiple times) between k and N objects is confusing.
  -
  -        ! The 'alias method' allows one to select from a discrete probability distribution of k objects (with object j having probability p_j) in O(1) time. 
  -        ! There's an O(k) storage and O(k) setup cost - a list of k reals (P_j) and k integers (Y_j)  which requires O(k) setup.
  +        ! The 'alias method' allows one to select from a discrete probability distribution of N objects 
  +        ! (with object i having probability p_i) in O(1) time. There's an O(N) storage and O(N) setup cost 
  +        ! - a list of N reals (P_i) and N integers (Y_i) which requires O(N) setup.
   
           ! Pick a random real number x, 0<=x<k.
           ! Let K=floor(x) and V=x-K. (so K is an integer and V the remainder).
  
positive.code:     end function select_weighted_value_prec
  
      ! [review] - JSS: is the alias method useful compared to simple binary search of the probabilities for one-off selections?
      function select_weighted_value(rng, N, weights, totweight) result(ret)
  
          ! Select an element, i=1..N with probability weights(i)/totweight.
  
negative.code: 
          !
          ! The alias method (a la Wikipedia)
          ! The distribution may be padded with additional probabilities /p_i / = 0 to 
          ! increase n to a convenient value, such as a power of two.
  
          ! To generate the table, first initialize /U_i / = /np_i /. While doing this, 
          ! divide the table entries into three categories:
  
          !  * The "overfull" group, where /U_i / > 1,
          !  * The "underfull" group, where /U_i / < 1, and
          !  * The "exactly full" group, where /U_i / = 1.
  
          ! If /U_i / = 1, the corresponding value K_i will never be consulted and is unimportant, 
          ! but a value of /K_i / = /i/ is sensible.
  
          ! As long as not all table entries are exactly full, repeat the following steps:
  
  