alerts functionality mostly complete