issue #3. First draft for fixing gradients