Corrected invalid variable initialization

Also added tons of debug printf statements