rewrite of the tutorial for the votes demo