Update shuffle function