Added basic voting algorithm