More precise math detection