added basic poll logic