changed debug print statements to alert boxes