fixes samplewithreplacement
inits hw7