Z-algo initially added