Refactored the code to have all of the triggered events happen in the trigger.cpp file.