formatting changes, renamed next_event to poll