made sampling with replacement easier.
Added notes.