Improve shuffling algorithm in explore