works and sends mail alerts!