New code to handle cross references on the fly