faster stackByZIndexIn: implementation