adding already computed rotations into the gradient computation
Former-commit-id: 5d9a50fb8af5e61c5a362b8679852af8626c1384