Added clipping test and code