Added ballot chcking code