Adding trunk sections on the fly and adding reference codes