What other mistakes are you refering to? As I replied to another monk above, my code runs perfectly with the modifications I made. Run it and you will see. I agree that his design is not ideal, but with the corrections I made it does work as he wants it to. My intention was not to redesign what he has, but to fix the error that generated the incorrect output.
davidj
Well, yes, removing "use strict" is one way to "fix" the compilation errors I referred to, and I failed to notice that your version had taken this approach.
Of course, this is usually not the approach that we would want to recommend for people who are having trouble getting their code right.