1. A method of spectrum data analysis, the method comprising the steps of: collecting a spectrum of an unknown material; providing a set of element data templates; calculate least squares weights for the element data templates in approximating the spectrum; removing one or more of the templates having negative weights in approximating the spectrum; and re-calculating an approximation of the spectrum with said one or more templates removed.