Added pseudo-random shuffle for testing.