var app = {
    initialize: function() {
        this.bind();
    },
    bind: function() {
        document.addEventListener('deviceready', this.deviceready, false);
    },
    deviceready: function() {
        // note that this is an event handler so the scope is that of the event
        // so we need to call app.report(), and not this.report()
        app.report('deviceready');
    },
    report: function(id) {
        console.log("report:" + id);
        // hide the .pending <p> and show the .complete <p>
        document.querySelector('#' + id + ' .pending').className += ' hide';
        var completeElem = document.querySelector('#' + id + ' .complete');
        completeElem.className = completeElem.className.split('hide').join('');
    }
};

@@ -212,19 +212,9 @@
  // 
-note that t
+T
 his 
@@ -233,18 +233,37 @@
 handler 
+function, which mean
 s
-o
  the sco
@@ -272,16 +272,8 @@
  is 
-that of 
 the 
@@ -277,16 +277,17 @@
 he event
+.
 %0A       
@@ -294,27 +294,39 @@
  // 
-so
+So,
  we 
-need to
+must explicitly
  call
- 
+ed %60
 app.
@@ -337,18 +337,22 @@
 rt()
-, and not 
+%60 instead of %60
 this
@@ -360,16 +360,18 @@
 report()
+%60.
 %0A       
@@ -428,24 +428,67 @@
 ction(id) %7B%0A
+        // Report the event in the console%0A
         cons
@@ -496,23 +496,24 @@
 le.log(%22
-r
+R
 eport:
+ 
 %22 + id);
@@ -513,16 +513,17 @@
  + id);%0A
+%0A
         
@@ -529,44 +529,177 @@
  // 
-hide the .pending %3Cp%3E and show
+Toggle the state from %22pending%22 to %22complete%22 for the reported ID.%0A        // Accomplished by adding .hide to the pending element and removing%0A        // .hide from
  the 
-.
 comp
@@ -707,11 +707,16 @@
 ete 
-%3Cp%3E
+element.
 %0A   

Update the JavaScript comments.