You can duplicate the layers to see how it works when you add more objects. Use the slider on the null to control the distance between each layer. The index value inside of “layer(index+1)” is looking at the layer below it. So if you change the stacking order it will alter how the position is calculated. I left some notes inside the expression to help you understand what is going on. As you will quickly figure out there is more than one to do something in AE, this is just one approach.