more fast approach of gradients computation