properly handle polling for sdl2
formatting changes