Moved echos out of the loop