Added proper Z order to counters