Edited the for loop rewrite code to include debugging capability.
Added boolean for if debugging
Added if and print statements to confirm new line being reached