proper z ordering