added line detection feature