add invertible check to normal equation
put all plots on one figure