fixing first order
 logD instead if D
 logD instead if D
 second-order