shuffle function finally works