adding alerts to debug results of function