Z-order updated, bugs fixed