Modified unit_chooser code