Card shuffle algorithm refactored.