Update to Javascript Math