fix broken math and formatting