CostFun->CostFunc
Gofmt'd everything to do the refactor