Yes it does alter the order of the presentation - this did not matter for my project - I just wanted the slides to be played in a different order each time I ran the presentation. If you need to keep the original order, the code won't help.

The last line just took me to the next slide - ignore it!