fixed important typo related to last commit: there was a bit of code right after the Grid gN that I deleted that relied on gN, and that is why the result I got after deleting it was wrong. Moved the code initializing gN to before this bit of code, and now I get the correct mode for Passive.