Real quick adjustment to make this work without calling prompts. or using alert.

I did use the console.log bit just to check that it was working.