Added comments to the alert function.