replacing wrong random shuffle implementation with a working one