Least Squares impl