cost function and its value