Changed debug output to identify stages