method for gradients added
structure change