added sum_squares method