reverted random_sample code to 03/08/13, as we're not sure yet what the
right patch for it is, and this version breaks other higher level code