Added the type of fit (e.g.,rscale,shift) as optional parameter.