'crop' function. close #12