Calculate votes

See commits below.