completed while.js example