implementing 'vote' functionality