replace individual puts with a iterative loop