Updated first line extraction