included a way to turn off debug mode via query string. Reordered some vars