anchor.diff:  
           !
           ! 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.
  +        ! 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:
  +        ! 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 K_i has not been
  -        !    initialized, and
  -        !  * The "exactly full" group, where /U_i / = 1 or K_i /has/ been
  -        !    initialized.
  +        !  * 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.
  +        ! 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:
   
  
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:         integer :: overfull(N)
          integer :: i, nunder, nover, ov, un
  
          aliasU = weights * (N / totweight)
          nunder = 0
          nover = 0
          do i = 1, N
              if (aliasU(i) <= 1.0_p) then
                  nunder = nunder + 1
                  underfull(nunder) = i
              else ! account for aliasU(i)=1 as underfull
                  nover = nover +1
                  overfull(nover) = i
              end if
              ! [review] - JSS: in case of what?!
              ! [review] - VAN: Sensible to set it in case there is a tiny numerical error
              ! [review] - VAN: when matching up the last underfull and overfull Us. 
              aliasK(i) = i ! This is a sensible safe choice in case aliasK(i) is not set below.
          end do
          do while (nover > 0 .and. nunder > 0)
              ! match the last nover with the last nunder
  