Add Amnon's latest select_gamma, plus unit tests