fixed original shuffle function