exercise #10, js updated