adjust line detection algorithm