Removing bad lines