added choice of random or not