exercise #8 JS updated