added simple clipping