def update_model_indices_residual_model(model_indices, accepted_index, n_modelpoints):
    """Update model indices and number of points in the residual model."""
    model_indices[1 : n_modelpoints + 1] = model_indices[:n_modelpoints]
    n_modelpoints += 1
    model_indices[0] = accepted_index

    return model_indices, n_modelpoints