experimenting with polling
reopening file
switching to poll from select