Added client side code for voting