a couple of improvements to the js, no functional changes