ex3 lrCostFunction