Adding crop helper function