template_math (with tests) added