changed select.poll() to select.kqueue() and select.event()