Updates to javascript (main)