replaced shuffle method