added choose random and 2n functions