Suggest how scientists may have determined that the Milky Way and Andromeda galaxies are moving closer together.

One way is detection of a Doppler blue shift of emission and absorption lines coming from stars in the galaxy (as opposed to the usual red shift of more distance galaxies)