Working out if statements for alerts.