Modified sample generating procedure.