implemented clipping