Made text-math better + more readable code