Various methods to count ballots in voting systems are provided. Functions to check validity of ballots are also provided to ensure flexibility.