Update computeCostAndGrad.m