clip function added