replaced math.mod with math.fmod