Implement sum of squares task