shellcheck.net run + correction for line counting routine
#9 problem with line counting