New crt and prime functions