 In order to more precisely analyze our expanding universe, modern cosmologists place a grid over three-dimensional space. We treat the distance between two galaxies, r, as a constant. Then we set the grid's scale factor, a, equal to one at the present time, and vary it to account for changes in distance over time instead of changing r. Now consider a cube enclosing a volume of space containing some number of galaxies. With our scale factor approach, the amount of matter inside the volume remains the same as the volume increases or decreases. But the matter density goes down when the scale factor increases, and it goes up when the scale factor decreases. We see that the matter density depends on the scale factor. Unlike matter that moves through space, photons are attached to the space they propagate through. So an expanding space will impact photons in a way that does not affect matter. Here's a cubic volume of space with a photon inside. The photon's wavelength, lambda, is equal to the length of the cube, a. This energy is equal to Planck's constant times the speed of light divided by the wavelength. As the wavelength increases with an increase in the scale factor, the energy decreases. Unlike matter where it remained constant. We see that the energy density also depends on the scale factor. In fact, we see that the scale factor, a, is the only variable. In other words, the history of the universe comes down to the history of the scale factor. And the history of the scale factor depends completely on the contents of the universe and how that content affects the space it exists in.