added improvements to the crop functions