adding optimizeallindices