implement randomized group assigner and tests