It's complete!

The error was that I was changing N and I would be checking a different
number than the amount it needed to be in a section. The way I handled
it is kind of silly, but it works pretty well. I just have N be the
number I can change, and N2 is the same number, but never changes. This
way I can change N back to the original number after subtracting from
it.