shuffle function complete