Continue updating trigger code (still not tested)