working on line detection(incomplete)