Much better index generation