Finally, fixed sampling program.