improved crop Z implementation