encorporated election loop, needs testing