Added a sampling feature