replaced Random with simpler 'sample' -- from video solution