improved the shuffle method