Using the alert function instead of the console to print out the result