Documented checkAndBuildLink function