I only mentioned it as an aside because I noticed both you and baavgai implemented your own shuffle
I used #include <algorithm> and the very function you pointed to. I assumed the OP did the same. I also assumed, given just "string" that "using namespace std;" was in affect. So, um, huh?
I missed the line when I was scanning through it. Sorry. I think I saw the push_back()'s and the push()'s, an it looked like it was just reordering the contents. As I said, I missed the random_shuffle() call.