math.c modifications