Javascript math could actually return a float. 8.000000001 for instance.  You may want to add toFixed(0) to ensure an integer is returned.