It would be better to write out this if/else over four lines.  The flow is hard to see here.  Also, why not `if (shuffle)`, why the inverted test?