add a debug comment line right before and after the loops.
like:
"entering the forward loop" ?
...
"leaved the forward loop" ?

with such lines, you can find out the exact section and line that does output stuff.
you on Gtalk?
_________________________
!

download KiXnet