Updated number of triggers code