got the shuffling function working