function sum_squares=badness(slopint)
global datax datay
[M,N] = size(datax);
theory_y = slopint(1)*datax + slopint(2);
sum_squares = sum((theory_y - datay).^2);
%end badness
