Updated JS

Updated the JS to account for incorrect floating point calculations.