Clarify the weighted_selection function