simplify zIndex calculation