Still not working , the gradient seems to be wrong