weighted voting, tail recursion