try to structure the math mess