Distribution and motions of H I in M31