Fixed error with indexing, least squares fit now accurately fits
function to diffraction patterns.  Currently only working for n=2 terms
and inaccurate on some data sets.