Some small changes in the math stuff