Changed from using putall once to put for each line