ver4.0

use of function 'sample' from random library