improvements in gradient expression