correct DOM order based on z-coordinate translations