Removing useless puts in the loop