>fibonacci.txt gets stuck in an infinite loop and never finishes.
Because it never processes a return token. Step through your code with a small test where you know all of the steps and when they happen. The first place that it doesn't step where you expect is going to give you a sign of what the problem is.