implemented voting mechanism