complete ex3.1 lrCostFunction