updated with example to solve for the equation of a line for least squares