fixed election code and working test