Added clip() function