Implement proper z ordering of blocks.