I can't seem to be able to even initialize N and M right. I have looked at answers to other questions and tried them but nothing seems to work. My code seems to almost work. Need to know what I'm missing here.