sample code from ntt .