1) Your code seems to be missing a lot. 2) it's better to post a small sample of the dictionary rather than the whole thing. 3) remove the comments that don't seem to say anything useful. 4) tell us what problems you are having