Dict comprehension fix

works on python 2.6, 2.7 and 3.3. I guess it works on python3.x. 
And the code is also nicer now.

I haven't checked on 2.5 or smaller, but I hope they could be considered obsolete versions.