* repeat with index works now.

* change the construction of let expression to avoid scoping issues
  that got triggered by 'var'.