Creating and using triggers