js version now works.