added general gradient using only fvar