Compile fn_selectRandomWeighted