adding debug alerts to code for testing the functions