gradient needs to be returned for the unusual case