built the first part of the triggering/alert system