Modified line detection code.