nnCostFunction ex4