added gradient constraint to unit norm