fixed int() casting bug that didn't evidence in 2.7

if you run the sample, it breaks because int() doesn't round in py3k evidently

added calls to int(math.floor(float()))