-Better logic for poll()