updated math in javascript