moved printout, loop is never executed?