opacity updated to piecewise