adding shuffle logic