Line segment pattern finding working and submitted