Rewrite player selection to fix some bugs