fix the math part