improved the elections example