Title: Spectral distribution and density of electromagnetic modes in rectangular cavities