implemented voting functionality