changing javascript. intermediate step 2