updated random_select method