least square final