random cutting function added