SMS dit: Least squares data fitting with applications