Nonvolatile memory read/writes not working for checking a pattern.  Thought it was maybe a problem with the fact that the read/write functions expecte unsigned long ints, but that does not appear to be the case, tested it with the read/write 55 scenario.