second attempt with js.