found a line detection algorithm, poking through the math