fixing math support (finally got it working)