Code to draw from non-uniform sample without replacement