Added cost function without regularization.