added least square solver