make crt and bezout template functions