added r-squared-fitting

Adapted from the least-squares-fit file, implements an R^2 fit