I totally understand your frustration on this matter.
I'm sorry if the explanation was confusing, but I really can't diagnose the bug without your feedback specifically on the checks that I asked for - when you said you've tried everything, what do you mean by that? Have you tried all of my suggestions?
I'm pretty much working in the dark here without your specific answer to my questions, and my effort here reduced to second guessing the results of these tests. (It's probably faster for me to read the entire code by this time
)
That said, I am guessing that your c value did not really decrement, because your "link-deleted" statement did not run at any point even if the link was removed. So,
=====================
Links.remove(j);
=====================
NEVER executed at any time (I am assuming that you did not do error catching here).
So I have a question here:
"On each iteration of the draw function i have a function to print both how many links and how many pages."
How did you implement the check function?
Please, please, please answer my questions instead of changing the topic! I know this is your program and you know more about it than anyone else, but very often that familiarity prevents effective proofreading of the code.