Added header with loose math template functions.