First attempt at adding Z order