refactoring for easier debugging, add sdl dependencies