Don't overwrite dicts in total_election()
Move class definitions out of function.