implemented shuffling