Wondering vaguely how many elves had now been set free whether they wanted to be or not, Harry uncorked his ink bottle, dipped his quill into it, then held it suspended an inch above the smooth yellowish surface of his parchment, thinking hard ... but after a minute or so he found himself staring into the empty grate, at a complete loss for what to say.
Harry Potter and the Order of the Phoenix
I don't quite understand the grammar of that part. I feel it should be: Wondering vaguely how many elves had now been set free and whether they wanted to be or not... But not sure if I got it right. How should we understand it?