The distance-least-squares (DLS) method and the valence-rule (VR) method are combined into a single computer program to predict bond lengths and bond angles in inorganic (static) crystal structures. The strength of the DLS method which allows refinement of the coordinates of all atoms in the asymmetric unit is preserved. Its weaknesses in positioning light atoms (H, Li) and in estimating polyhedral distortion are eliminated by introducing the valence rule condition: the sum of bond strengths around each atom has to agree with its formal valence. Consequently, the objective function to be minimized consists of three terms: the distance-, angle-, and valence-least-squares terms (DVLS method). Examples of structure simulations using the DVLS program are given and are compared with results based on the VR method as given in the literature.