remove old cost function