messed up the randomized sort