votes controller and javascript stuff