update shuffle function