Modeling the ages and chemical abundances of elliptical galaxies