policy, s);

  case 'dCdm'
      [dd dy dh] = checkgrad(@conT2, m, delta, policy, s);

  case 'dMds'
      [dd dy dh] = checkgrad(@conT3, s(tril(ones(d))==1), delta, policy, m);

  case 'dSds'
      [dd dy dh] = checkgrad(@conT4, s(tril(ones(d))==1), delta, policy, m);

  case 'dCds'
      [dd dy dh] = checkgrad(@conT5, s(tril(ones(d))==1), delta, policy, m);

  case 'dMdp'
      [dd dy dh] = checkgrad(@conT6, policy.p, delta, policy, m, s);
 
  case 'dSdp'
      [dd dy dh] = checkgrad(@conT7, policy.p, del