  Given a graph $G$, a subgraph $H$ is isometric if $d_H(u,v) = d_G(u,v)$ for
every pair $u,v\in V(H)$, where $d$ is the distance function. A graph $G$ is
distance preserving (dp) if it has an isometric subgraph of every possible
order. A graph is sequentially distance preserving (sdp) if its vertices can be
ordered such that deleting the first $i$ vertices results in an isometric
subgraph, for all $i\ge1$. We introduce a generalisation of the lexicographic
product of graphs, which can be used to non-trivially describe graphs. This
generalisation is the inverse of the modular decomposition of graphs, which
divides the graph into disjoint clusters called modules. Using these
operations, we give a necessary and sufficient condition for graphs to be dp.
Finally, we show that the Cartesian product of a dp graph and an sdp graph is
dp.
