regularizaed cost function