Implemented 3.lsfit