Added Nikhil's JavaScript modifications