make line count more robust
everything working