Revert "Ass least squares cost function"

This reverts commit 77f6198b4a1d5e07d768780c2d640faf671fcd81.