sample2 function

Takes samples in the usual manner