A theoretical study of the electronic spectra of pyridine and phosphabenzene