Using indices when building data