Made math work properly in python 2 and 3

Old code was doing an integer division, essentially useless