Changed random double generate algorithm/ Added reservoir sample