added chapter6.js