tile shuffle function