Added some comments and changed some javascript alerts