Added costfun...