fixed randomization algorithm, pair programmed with zack