exercise #3 JS updated