Adds collector code