fix shuffle, and minor changes