add math detection