more robust indexing