Have you tried stepping through the code in a debugger?

Won't that pretty much answer the question for you?