move declaration of line into loop