corrected routine for two sources doc-sim