Corrected Typos, and added debug statements