The problem is that one element, say natrium, has many spectral lines of varying strength. You're trying to find a set of elements that best explains the measured spectrum. If you plotted all spectral lines from all elements on a spectrum, it would be completely black because there are so many. In the end it only worked well for fluorescent tubes, but it could tell you what's in them, even things a human would have a very hard time discovering by looking at the spectrum and manually comparing it to the NIST database (the university has all kinds of weird lamps like natrium lamps, blacklights, and fluorescent tubes in many colors all containing different stuff, and looking at computer monitor pixels is fun too).
My program output an element X who's name I forgot for many of the lamps, but when I plotted its spectral lines over the spectra I couldn't see the match clearly, so I added a parameter to the algorithm so that it would be more restrictive on the number of different elements returned. In the presentations of the lab the prof commented "many of these tubes also contain element X, but you can't see it with the spectrum analyzer you used, you need a higher quality one". Bummer.