fixed refactored SDL code to include pointer to pointer convention