added wrapXVal and wrapYVal to extractPeaks(). Also added helpful comments in extractPeaks()