vectorise violation in gradient2