added indices to assets and made generation happen in a top-to-bottom order (originally was bottom to top)