Updated js file with Jack's latest code