Background and peak fitting of x-ray diffractograms