Implemented Shuffle logic