added an option to switch event polling
clean up
comments